import { musicStore } from "../../store/index"

// components/song-item-index/index.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    index:{
      type:Number,
      value:1
    },
    songInfo:{
      type:Object,
      value:{}
    }
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    playMusic(e){
      const id = e.currentTarget.dataset.id
      wx.navigateTo({
        url: `/pages/music-detail/index?id=${id}`
      })
      musicStore.dispatch('playMusicWithIdAction',id)
    }
  }
})
